//
//  BaseViewController.m
//  AroundTheWorld
//
//  Created by IfelseGo on 16/5/14.
//  Copyright © 2016年 IfelseGo an. All rights reserved.
//

#import "BaseViewController.h"


@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //夜间模式
    self.view.dk_backgroundColorPicker = DKColorPickerWithRGB(0xffffff,0xCFCFCF);
    self.navigationController.navigationBar.dk_barTintColorPicker = DKColorPickerWithRGB(0x3AA082,0xCFCFCF);
    //添加夜间模式按钮
    UIButton *naight = [UIButton buttonWithType:UIButtonTypeCustom];
    [naight setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
    naight.frame = CGRectMake(25, 25, 30, 30);
    [self.view addSubview:naight];
    [naight addTarget:self action:@selector(buttonAtcion:) forControlEvents:UIControlEventTouchUpInside];

    // Do any additional setup after loading the view.
}

//夜间模式判断
- (void)buttonAtcion:(UIBarButtonItem *)item{
    if ([self.dk_manager.themeVersion isEqualToString:DKThemeVersionNight]) {
        item.image = [[UIImage imageNamed:@""] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
        //        [self.isNightButton setImage:[UIImage imageNamed:@"btn_sun32"] forState:UIControlStateNormal];
        NSLog(@"白天");
        [self.dk_manager dawnComing];
    } else {
        NSLog(@"晚上");
        item.image = [[UIImage imageNamed:@""] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
        //        [self.isNightButton setImage:[UIImage imageNamed:@"btn_sun_night"] forState:UIControlStateNormal];
        [self.dk_manager nightFalling];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
